package com.gzx.plugin.tjzy.modular.sms.batch.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.gzx.plugin.tjzy.modular.sms.batch.entity.GzxSmsDetail;
import com.gzx.plugin.tjzy.modular.sms.batch.mapper.GzxSmsDetailMapper;
import com.gzx.plugin.tjzy.modular.sms.batch.service.GzxSmsDbService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zjt
 * @description
 * @date 2025/7/22 15:57
 */
@Service
@DS("sms")
@RequiredArgsConstructor
public class GzxSmsDbServiceImpl implements GzxSmsDbService {

    private final GzxSmsDetailMapper smsDetailMapper;

    /**
     * 保存短信发送的短信ID
     *
     * @param smsDetailList
     */
    @Override
    public void saveMsgId(List<GzxSmsDetail> smsDetailList) {
        smsDetailMapper.saveMsgId(smsDetailList);
    }

    /**
     * 修改短信明细
     *
     * @param lambdaUpdateWrapper
     */
    @Override
    public void updateDetail(LambdaUpdateWrapper<GzxSmsDetail> lambdaUpdateWrapper) {
        smsDetailMapper.update(lambdaUpdateWrapper);
    }

    /**
     * 查询短信明细
     *
     * @param lambdaQueryWrapper
     * @return
     */
    @Override
    public List<GzxSmsDetail> listDetail(LambdaQueryWrapper<GzxSmsDetail> lambdaQueryWrapper) {
        return smsDetailMapper.selectList(lambdaQueryWrapper);
    }
}
